<template>
	<view class="accomplish">
		<image src="../../static/technician/pay_success.png" v-if="data.is_pay == 1"></image>
		<image src="../../static/technician/pay_error.png" v-if="data.is_pay == 0"></image>
		<h1>￥{{data.pay_amount}}</h1>
		<p>{{data.is_pay == 1?'支付成功':'支付失败'}}</p>
		<view>
			<p><span>支付方式</span><span>{{data.pay_type==1?'余额支付':'微信支付'}}</span></p>
			<p><span>订单号</span><span>{{data.order_sn}}</span></p>
			<p><span>支付时间</span><span>{{data.pay_time}}</span></p>
			<p><span>交通费</span><span>{{data.traffic_fee}}</span></p>
			<p><span>服务费</span><span>{{data.service_fee}}</span></p>
			<p><span>优惠券</span><span>{{data.coupon_amount}}</span></p>
			<p><span>总金额</span><span>{{data.total_amount}}</span></p>
			<p><span>支付金额</span><span>{{data.pay_amount}}</span></p>
		</view>
		<button @click="skip('/pages/order/order')">查看详情</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				order_sn:'',
				data:{},
				order_type:''
			};
		},
		onLoad(res) {
			uni.removeStorageSync('goods_num')
			uni.removeStorageSync('work_time')
			this.order_sn=res.order_sn
			this.order_type=res.order_type
			this.$httpRequest('/pay/getPayInfo',{order_sn:this.order_sn,order_type:this.order_type}).then(res=>{
				this.data=res.data
			})
		},
		methods:{
			skip(url){
				uni.switchTab({
					url,
				})
			}
		},
	}
</script>

<style lang="less">
.accomplish{
	padding-top: 124rpx;
	&>image{
		width: 109px;
		height: 106px;
		margin: 0 auto;
		display: block;
	}
	&>h1{
		text-align: center;
		font-size: 25px;
		margin-top: 50rpx;
	}
	&>p{
		color: #999999;
		font-size: 12px;
		text-align: center;
	}
	&>view{
		width: 618rpx;
		margin: 50rpx auto 0;
		border-top: 1px solid #E1E1E1;
		&>p{
			margin: 14rpx 0;
			display: flex;
			justify-content: space-between;
			font-size: 10px;
			color: #666666;
		}
	}
	&>button{
			width: 440rpx;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 50rpx;
			color: #fff;
			background: #5FC07B;
			font-size: 15px;
			margin-top: 114rpx;
		}
}
</style>
